//
//  DJScrollViewController.swift
//  dj-learn-Swift
//
//  Created by Sun Jae on 2022/4/27.
//  Copyright © 2022 S.J. All rights reserved.
//

import UIKit

class DJScrollViewController: DJViewController {

    override func viewDidLoad() {
        super.viewDidLoad()

       
        let scrollView = UIScrollView()
        scrollView.contentSize = CGSize(width: 0, height: UIScreen.main.bounds.size.height)
        self.view.addSubview(scrollView)
        
        scrollView.backgroundColor = UIColor.red
        scrollView.snp.makeConstraints { (make) in
            make.edges.equalTo(self.view)
        }
        
        // scrollView 的 top/bottom/right/left 指的的content区域的
        let view1 = UIView()
        view1.backgroundColor = UIColor.green
        scrollView.addSubview(view1)
        view1.snp.makeConstraints { (make) in
            make.top.equalTo(scrollView)
            make.left.right.equalTo(scrollView)
            make.width.equalTo(scrollView)
            make.bottom.equalTo(scrollView)
        }
        
        let view2 = UILabel()
        view2.numberOfLines = 0
        view1.addSubview(view2)
        view2.snp.makeConstraints { (make) in
            make.top.equalTo(view1).offset(10)
            make.left.equalTo(view1).offset(10)
            make.right.equalTo(view1).offset(-350)
            make.height.equalTo(1000)
            make.bottom.equalTo(view1)
        }
        view2.text = "sadfgesdgdwfgasdk'flasldkas;d'fjasdfkl;asdkfjas;klfdajksldfasjdklfsjkadlfasjdflasdjfalsdfjasldfjasldfjasldfjasldfjasdfjlasdjfasldfjalsdfjasldfljasdflajsldflasdfjasldfajsdf"
 
    }
}
